<?php

/**
 * @filename swoole_process.php
 * @encoding UTF-8 
 * @author  fwz
 * @datetime 2018-6-12  15:06:47
  */

//创建进程
//进程对应的执行函数
function doprocess(swoole_process $worker){
    echo "PID".$worker->pid."\n";
    sleep(5);
}

//创建进程
$process = new swoole_process("doProcess");
$pid = $process->start();


$process = new swoole_process("doProcess");
$pid = $process->start();


$process = new swoole_process("doProcess");
$pid = $process->start();

//等待结束。 
swoole_process::wait();


